import axios from '../utils/http'; // 导入http中创建的axios实例
import { Base64 } from '../utils/base';
let baseObj = new Base64()
const base_url = process.env.BASE_API;
const inter_url = '/proxy/cam/proxy/common?api=';
const commonApi = {
  // 维修中心获取展厅接口
  getShowOrgByFixCenterId(params) {
    let url = 'CustomerSolicitFacade-getShowOrgByFixCenterId'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },
  // 获取车型
  getCarModel(params) {
    let url = 'CustomerSolicitFacade-getCarModel'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },
  // 获取车辆来源
  getBaseCode(params) {
    let url = 'CustomerSolicitFacade-getBaseCode'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },
  // 获取服务顾问
  getEmpPerson(params) {
    let url = 'CustomerSolicitFacade-getEmpPerson'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },

  // 获取枚举信息
  getEnums(params) {
    let url = 'CustomerSolicitFacade-getEnums'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },

  // 获取配件价格
  getMaterialPriceType(params) {
    let url = 'CustomerSolicitFacade-getMaterialPriceType'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },

  // 获取维修价格
  getRepairpricetype(params) {
    let url = 'CustomerSolicitFacade-getRepairpricetype'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },

  // 根据维修中心获取品牌数据
  getBrandByFixCenter(params) {
    let url = 'CustomerSolicitFacade-getBrandByFixCenter'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },

  // 获取当前人的维修中心
  getMainFixCenter(params) {
    let url = 'CustomerSolicitFacade-getMainFixCenter'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },

  // 获取任务表任务类型信息
  getTaskType(params) {
    let url = 'CustomerSolicitFacade-getTaskType'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },

    // 上传文件
  uploadFiles(params) {
    let url = '/proxy/cam/file/uploadFiles'
    return axios.post(`${base_url}${url}`, params);
  },
    // 下载文件
  downloadFile(params) {
    let url = '/proxy/cam/file/download'
    return axios.get(`${base_url}${url}`, {params});
  },
    // 文件列表
  getFileList(params) {
    let url = '/proxy/cam/file/list'
    console.log(params);
    return axios.get(`${base_url}${url}`, {params});
  },

  // 身份证识别
  getIDCardInformation(params) {
     let url = 'CustomerSolicitFacade-getIDCardInformation'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },

    // 行驶证识别
  getDriverCardInformation(params) {
     let url = 'CustomerSolicitFacade-getDriverCardInformation'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params);
  },
  // 获取微信jsdk配置
  jsdkConfig(params) {
    return axios.post(`${base_url}/proxy/qywx/jsdkConfig`, params);
  },

}

export default commonApi;
